~ chicken-core (master) /manual/Module (scheme read)


 1[[tags: manual]]
 2[[toc:]]
 3
 4== Module (scheme read)
 5
 6<procedure>(read [port])</procedure>
 7
 8If port is omitted from {{read}}, it defaults to the value returned by 
 9(current-input-port). It is an error to attempt an input operation on a closed
10port.
11
12The read procedure converts external representations of Scheme objects into the
13objects themselves. That is, it is a parser for the non-terminal <datum>. 
14It returns the next object parsable from the given
15textual input port, updating
16port to point to the first character past the end of the external
17representation of the object.
18
19If an end of file is encountered in the input before any characters are found
20that can begin an object, then an end-of-file object is returned. The port
21remains open, and further attempts to read will also return an end-of-file
22object. If an end of file is encountered after the beginning of an object’s
23external representation, but the external representation is incomplete and
24therefore not parsable, an error that satisfies read-error? is signaled.
25
26---
27Previous: [[Module (scheme process-context)]]
28
29Next: [[Module (scheme repl)]]
Trap